﻿    @(Html.X().Toolbar()
        .ID("app-header")
        .Region(Region.North)
        .Padding(2)
        .Height(51)
        .Items(
            new Component
            {
                Html = string.Format("<div id='app-header-title'>{0}</div>", PageData["AppName"])
            },

            new ToolbarFill(),

            new Button
            {
                Icon = Icon.StatusOnline,
                Text = Convert.ToString(PageData["Username"]),
                Menu = 
                { 
                    new Menu
                    {
                        Items = 
                        {
                            new MenuItem
                            {
                                Text = "Cambiar password",
                                Icon = Icon.Key,
                                DirectEvents =
                                {
                                    Click =
                                    {
                                        Url = Url.Action("FrmCambiarClave", "Account", new { area = "" }),
                                        Before = "Ext.getBody().mask('Cargando...!', 'x-mask-loading');",
                                        Complete = "Ext.getBody().unmask();"
                                    }
                                }
                            },
                            
                            new MenuSeparator(),
                            
                            new MenuItem
                            {
                                Text="Cerrar sesión",
                                Icon=Icon.LockGo,
                                DirectEvents=
                                {
                                    Click=
                                    {
                                        Url = Url.Action("LogOff", "Account", new { area = "", ReturnUrl = Url.Action("Index", "Home", new { area = "" }) }),
                                        Before = "Ext.getBody().mask('Hasta pronto!', 'x-mask-loading');",
                                        Complete = "Ext.getBody().unmask();"
                                    }
                                }
                            }
                        }
                    }   
                }
            }
        )
    )